* Private function declarations
*/
+extern void _gdk_win32_window_invalidate_egl_framebuffer (GdkWindow *window);
+
#define SYNAPSIS_ICON_WINDOW_CLASS "SynTrackCursorWindowClass"
static gboolean gdk_event_translate (MSG *msg,
case SC_MINIMIZE:
case SC_RESTORE:
do_show_window (window, msg->wParam == SC_MINIMIZE ? TRUE : FALSE);
+
+ if (msg->wParam == SC_RESTORE)
+ _gdk_win32_window_invalidate_egl_framebuffer (window);
break;
case SC_MAXIMIZE:
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
}
}
+static gboolean
+_get_is_egl_force_redraw (GdkWindow *window)
+{
+ /* We only need to call gdk_window_invalidate_rect () if necessary */
+#ifdef GDK_WIN32_ENABLE_EGL
+ if (window->gl_paint_context != NULL && gdk_gl_context_get_use_es (window->gl_paint_context))
+ {
+ GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+
+ return impl->egl_force_redraw_all;
+ }
+#endif
+ return FALSE;
+}
+
+static void
+_reset_egl_force_redraw (GdkWindow *window)
+{
+#ifdef GDK_WIN32_ENABLE_EGL
+ if (window->gl_paint_context != NULL && gdk_gl_context_get_use_es (window->gl_paint_context))
+ {
+ GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+
+ if (impl->egl_force_redraw_all)
+ impl->egl_force_redraw_all = FALSE;
+ }
+#endif
+}
+
void
_gdk_win32_gl_context_end_frame (GdkGLContext *context,
cairo_region_t *painted,
}
}
- /* EGL does not have do_blit_swap */
if (context_win32->do_blit_swap)
{
glDrawBuffer(GL_FRONT);
else
{
EGLSurface egl_surface = _gdk_win32_window_get_egl_surface (window, context_win32->egl_config, FALSE);
+ gboolean force_egl_redraw_all = _get_is_egl_force_redraw (window);
+
+ if (context_win32->do_blit_swap && !force_egl_redraw_all)
+ gdk_gl_blit_region (window, painted);
+ else if (force_egl_redraw_all)
+ {
+ GdkRectangle rect = {0, 0, gdk_window_get_width (window), gdk_window_get_height (window)};
+
+ /* We need to do gdk_window_invalidate_rect() so that we don't get glitches after maximizing or
+ * restoring or using aerosnap
+ */
+ gdk_window_invalidate_rect (window, &rect, TRUE);
+ _reset_egl_force_redraw (window);
+ }
+
eglSwapBuffers (display->egl_disp, egl_surface);
}
#endif
context_win32 = GDK_WIN32_GL_CONTEXT (window->gl_paint_context);
context_win32->do_blit_swap = FALSE;
- /* gdk_gl_context_has_framebuffer_blit() is for Desktop GL only ! */
if (gdk_gl_context_has_framebuffer_blit (window->gl_paint_context) &&
cairo_region_contains_rectangle (update_area, &whole_window) != CAIRO_REGION_OVERLAP_IN)
{
return TRUE;
}
+
+void
+_gdk_win32_window_invalidate_egl_framebuffer (GdkWindow *window)
+{
+/* If we are using ANGLE, we need to force redraw of the whole Window and its child windows
+ * as we need to re-acquire the EGL surfaces that we rendered to upload to Cairo explicitly,
+ * using gdk_window_invalidate_rect (), when we maximize or restore or use aerosnap
+ */
+#ifdef GDK_WIN32_ENABLE_EGL
+ if (window->gl_paint_context != NULL && gdk_gl_context_get_use_es (window->gl_paint_context))
+ {
+ GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+
+ impl->egl_force_redraw_all = TRUE;
+ }
+#endif
+}
window_impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
window_impl->inhibit_configure = TRUE;
+ _gdk_win32_window_invalidate_egl_framebuffer (window);
+
/* We ignore changes to the window being moved or resized by the
user, as we don't want to fight the user */
if (GDK_WINDOW_HWND (window) == _modal_move_resize_window)
GDK_WINDOW_HWND (window),
_gdk_win32_window_state_to_string (window->state)));
+ _gdk_win32_window_invalidate_egl_framebuffer (window);
+
if (GDK_WINDOW_IS_MAPPED (window))
GtkShowWindow (window, SW_MAXIMIZE);
else
GDK_WINDOW_HWND (window),
_gdk_win32_window_state_to_string (window->state)));
+ _gdk_win32_window_invalidate_egl_framebuffer (window);
+
if (GDK_WINDOW_IS_MAPPED (window))
GtkShowWindow (window, SW_RESTORE);
else
case SW_SHOWNA:
case SW_SHOWNOACTIVATE:
case SW_SHOWNORMAL:
+ _gdk_win32_window_invalidate_egl_framebuffer (window);
+
if (IsWindowVisible (hwnd))
break;